#include <stdio.h>
#include <stdlib.h>
#include "calc.h"

 // ./calc 11 22: argc =3, argv[0] = "./calc", argv[1] ="11", argv[2] = "22"
 
int main(int argc, char * argv[])
{
 int a = 0;
 int b = 0;
 int c = 0;
 int e = 0;
 int g = 0;
 int h = 0; 
 if (argc < 3)
 {
    printf("usage : ./calc para1 para2 \n");
    return 75;
 }
 a=atoi(argv[1]);
 b=atoi(argv[2]);
  
 c = add(a,b);
 e = sub(a,b);
 g = mul(a,b);
 
 printf("%d + %d = %d\n",a,b,c);
 printf("%d - %d = %d\n",a,b,e);
 printf("%d * %d = %d\n",a,b,g);
 
 if(b == 0)
 {
    printf("%d / %d = false\n",a,b);
 }
 else
 { 
    h = divi(a,b);
    printf("%d / %d = %d\n",a,b,h);
 }

return 0;
}
 
 
